﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Server.Users;
using Server.Models;
using Server.BaseManage;
using Server.Invoice;

namespace Server.Share
{
    public class CShare
    {
        public CUserBLL cUserCtrl = new CUserBLL();
        public UserInfo uinfo = new UserInfo();
        public BaseManageBLL bCtrl = new BaseManageBLL();
        public InvoiceBLL iCtrl = new InvoiceBLL();
        public void CheckInfo(string Token)
        {
            try
            {
                if (!string.IsNullOrEmpty(Token))
                {
                    //验证Token
                    if (!cUserCtrl.CheckUser(Token))
                        throw new Exception("验证用户出错,请重新登录!");
                    //获取用户信息
                    uinfo = cUserCtrl.GetUserByToken(Token);
                }
                else
                {
                    throw new Exception("验证信息出错,请重新登录");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }

    }
}
